package com.yesun.dcm.rpc.protocol;

import com.yesun.dcm.rpc.Exporter;
import com.yesun.dcm.rpc.Invoker;

public class AbstractExporter<T> implements Exporter<T> {

    private Invoker<T> invoker;
    private volatile boolean unexported = false;

    public AbstractExporter(Invoker<T> invoker) {
        this.invoker = invoker;
    }

    @Override
    public Invoker<T> getInvoker() {
        return invoker;
    }

    @Override
    public void unExport() {
        if (unexported) {
            return;
        }
        unexported = true;
    }

}
